package kr.ragne.letsparis;

import java.util.Random;

import kr.ragne.framework.AppManager;
import kr.ragne.letsparitime.R;

public class Missile_1 extends Missile {
	Random rnd = new Random();
	float rad;
	float a;
	private int i;
	private int timer;

	public Missile_1(int i, int timer) {
		super(AppManager.getInstance().getBitmap(R.drawable.bullet_1));
		this.i = i;
		this.timer = timer;
	}

	@Override
	public void Move() {
		// 움직이는 로직
		rad += 0.1;
		if (movetype == MOVE_PATTERN_1) {
			mX -= speed;
			mY -= 0.5;
		}
		if (movetype == MOVE_PATTERN_2) {
			mX -= speed;
			mY -= 0.1;
		}	
		if (movetype == MOVE_PATTERN_3) {
			mX -= speed;
			mY -= 0.7;
		}
		if (movetype == MOVE_PATTERN_4) {
			mX -= speed;
			mY -= 1.2;
		}
		if (movetype == MOVE_PATTERN_5) {
			mX -= speed;
			mY -= 1.5;
		}
		if(timer>=10000){
			if (movetype == MOVE_PATTERN_6) {
				mX -= speed;
				mY -= speed * Math.cos(Math.toRadians(rad));
				rad += 1;
			}	
		}
		if(timer >= 20000){
			if (movetype == MOVE_PATTERN_7) {
				mX -= speed*speed;
				mY = mY - i +(i/10);
			}	
		}
		if(timer >= 30000){
			if (movetype == MOVE_PATTERN_8) {
				mX -= speed * 2;
				mY = (mY - 2) - (i + i / 10) + rad + rad;
			}	
		}

		if (mX < 0) {
			state = STATE_OUT;
		}

		boundBox.set((int) mX, (int) mY, (int) mX + 20, (int) mY + 20);
	}

	@Override
	void Update(long gameTime) {
		super.Update(gameTime);
	}

}
